/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.colegiatura.be.ExperienciaLaboral;

/**
 *
 * @author ADMINISTRADOR
 */
public class ExperienciaLaboralDelegate {

    private ExperienciaLaboralFacadeLocal local;

    public ExperienciaLaboralDelegate() {

        local = lookupExperienciaLaboralFacade();
    }

    public void create(ExperienciaLaboral experienciaLaboral){

        local.create(experienciaLaboral);
    }

    public void edit(ExperienciaLaboral experienciaLaboral){

        local.edit(experienciaLaboral);
    }

    public void remove(ExperienciaLaboral experienciaLaboral){

        local.remove(experienciaLaboral);
    }

    public ExperienciaLaboral find(Object id){

        return local.find(id);
    }

    public List<ExperienciaLaboral> findAll(){

        return local.findAll();
    }

    public List<ExperienciaLaboral> listaExpColegiado(Long codigo){

        return local.listaExpColegiado(codigo);
    }

    

    private ExperienciaLaboralFacadeLocal lookupExperienciaLaboralFacade() {
        try {
            Context c = new InitialContext();
            return (ExperienciaLaboralFacadeLocal) c.lookup("java:comp/env/ExperienciaLaboralFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }


}
